/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.vce.election.domain;

import com.vce.*;
import java.util.List;

/**
 *
 * @author Ggutierrez
 */
public class State implements Persistent{
    private Long id;
    private int code;
    private String name;
    private boolean capital;
    private int senators;
    private Audit audit;
    private List<Town> towns;

    public State() {
    }

    public State(int code, String name, boolean capital, int senators, Audit audit) {
        this.code = code;
        this.name = name;
        this.capital = capital;
        this.senators = senators;
        this.audit = audit;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public boolean isCapital() {
        return capital;
    }

    public void setCapital(boolean capital) {
        this.capital = capital;
    }

    public int getSenators() {
        return senators;
    }

    public void setSenators(int senators) {
        this.senators = senators;
    }

    public Audit getAudit() {
        return audit;
    }

    public void setAudit(Audit audit) {
        this.audit = audit;
    }
    
    @Override
    public int hashCode() {
        return id.hashCode();
    }

    @Override
    public boolean equals(Object other) {
        if (other == this) {
            return true;
        }
        if (!(other instanceof State)) {
            return false;
        }
        State _o = (State) other;
        return id.equals(_o.id);
    }

    public List<Town> getTowns() {
        return towns;
    }

    public void setTowns(List<Town> towns) {
        this.towns = towns;
    }
}